package cn.com.open.itembank.appender;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

public class LogTester {

    private static Logger logger = LoggerFactory.getLogger(LogTester.class);

    public static void main(String[] args) {
        try {
            int i = 1/0;
        }catch (Exception e){
            MDC.put("errorCode_"+Thread.currentThread().getName(),"-119");
            logger.error("-118",e);
        }finally {
            Object o = MDC.get("errorCode_"+Thread.currentThread().getName());
            System.out.println(o);
            MDC.remove("errorCode_"+Thread.currentThread().getName());
        }
    }
}
